load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "parse",
    srcs = ["parse.go"],
    importpath = "github.com/pingcap/tidb/server/internal/parse",
    visibility = ["//server:__subpackages__"],
    deps = [
        "//errno",
        "//expression",
        "//parser/charset",
        "//parser/mysql",
        "//server/internal/handshake",
        "//server/internal/util",
        "//sessionctx/stmtctx",
        "//types",
        "//util/dbterror",
        "//util/hack",
        "//util/logutil",
        "@com_github_klauspost_compress//zstd",
        "@org_uber_go_zap//:zap",
    ],
)

go_test(
    name = "parse_test",
    timeout = "short",
    srcs = [
        "handshake_test.go",
        "parse_test.go",
    ],
    embed = [":parse"],
    flaky = True,
    shard_count = 4,
    deps = [
        "//expression",
        "//parser/mysql",
        "//parser/terror",
        "//server/internal/handshake",
        "//server/internal/util",
        "//sessionctx/stmtctx",
        "//types",
        "@com_github_stretchr_testify//require",
    ],
)
